﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

//////////////////////////////////////////////////////////////////////////
//AdvisorInfo.aspx.cs                                                   //
//Last Edited: 23 Mar 2012                                              //
//                                                                      //
//Displays advisor information for the current user, including          //
//  name, email, phone, and office location.                            //
//////////////////////////////////////////////////////////////////////////
public partial class Advisee_AdvisorInfo : System.Web.UI.Page
{
    //////////////////
    //Page Functions//
    //////////////////

    /// <summary>
    /// Page_Load()
    /// 
    /// Initializes the page.
    /// </summary>
    /// <param name="sender">object sender (unused, required by ASP.NET) - web control that called the function</param>
    /// <param name="e">EventArgs e (unused, required by ASP.NET) - other arguments for the function</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        //Populate the main box with the advisor information
       // Dictionary<String, Object> results = StoredProcedures.getAdvisor(SharedFunctions.getAdviseeID(Request));
        List<Dictionary<String, Object>> resultList = StoredProcedures.getMultipleAdvisors(SharedFunctions.getAdviseeID(Request));
        AdvisorInfo.Text = "";
        foreach (Dictionary<String, Object> i in resultList)
        {
            AdvisorInfo.Text += "Name: " + i["firstName"] + " " + i["lastName"] + "<br />";
            AdvisorInfo.Text += "Email: " + i["email"] + "<br />";
            AdvisorInfo.Text += "Office: " + i["location"] + "<br />";
            AdvisorInfo.Text += "Phone: " + i["phone"] + "<br /><br />";
        }
    } //end Page_Load()

    /// <summary>
    /// CloseButton_Click()
    /// 
    /// Called when user clicks the close button.
    /// </summary>
    /// <param name="sender">object sender (unused, required by ASP.NET) - web control that called the function</param>
    /// <param name="e">EventArgs e (unused, required by ASP.NET) - other arguments for the function</param>
    protected void CloseButton_Click(object sender, EventArgs e)
    {
        //Redirect back to default
        Response.Redirect("~/Advisee/Default.aspx");
    } //end CloseButton_Click()

    /// <summary>
    /// HelpButton_Click()
    /// 
    /// Called when user clicks the help button.
    /// </summary>
    /// <param name="sender">object sender (unused, required by ASP.NET) - web control that called the function</param>
    /// <param name="e">EventArgs e (unused, required by ASP.NET) - other arguments for the function</param>
    protected void HelpButton_Click(object sender, EventArgs e)
    {
        //Redirect to help page
        Response.Redirect("~/Advisee/Help.aspx");
    } //end HelpButton_Click()
}